#pragma once
#include <windows.h>
#include "MemoryManager/memdebug.h"
#include "Engine/Engine Classes/Engine/Engine.h"
#include "mtypes.h"
#include "Test.h"

class CApplication
{
protected:
	CApplication               ( int a_iWidth, int a_iHeight );
    
	int  m_iWidth;
	int  m_iHeight;
	HWND m_hWnd;
	HDC  m_hDC;
	bool m_bActive;
    int  m_iCursorPosX;
    int  m_iCursorPosY;
    int  m_iCurPosdX;
    int  m_iCurPosdY;
    bool m_bKeys[256];
    CTestObj *m_pTestObj;
    CEngine m_Engine;

    void ShowWindow             ( );
    void InitWindow             ( RECT a_WindowRect );
    virtual void InitScene      ( );
    virtual void ResizeScene    ( int a_iWidth, int a_iHeight );
    void         SetActive      ( bool a_bActive );
    virtual void RenderScene    ( );
    virtual void UpdateScene    ( );    

public:            
    virtual bool OnInput        ( UINT a_Msg, int a_WParam, long a_LParam );
    virtual void RenderText     ( RECT rect, char *fmt, ... ) = 0;
    void         Exec           ( );
	static CApplication* Create ( int a_iWidth, int a_iHeight, API_VERSION a_Ver );
	virtual ~CApplication       ( );
};
